﻿using Guest_room.BLL;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Guest_room.admin
{
    public partial class orderdetails : Form
    {
        public orderdetails()
        {
            InitializeComponent();
        }
        GuestRoomService guestRoomService = new GuestRoomService();
        private void orderdetails_Load(object sender, EventArgs e)//窗体加载函数
        {
            int orderId = audit.orderid; // 假设audit对象已经存在并包含订单编号
            DataTable dt = guestRoomService.GetOrderDetails(orderId);

            label9.Text = dt.Rows[0]["订单编号"].ToString();
            label19.Text = dt.Rows[0]["入住经办员编号"].ToString();
            label14.Text = dt.Rows[0]["客房编号"].ToString();
            label32.Text = dt.Rows[0]["客房单价"].ToString();
            label23.Text = dt.Rows[0]["客房档次"].ToString();
            label27.Text = dt.Rows[0]["客房电话"].ToString();
            label11.Text = dt.Rows[0]["入住天数"].ToString();
            label13.Text = dt.Rows[0]["入住人数"].ToString();
            label15.Text = dt.Rows[0]["入住时间"].ToString();
            label16.Text = dt.Rows[0]["订单总价"].ToString();
            label10.Text = dt.Rows[0]["客户编号"].ToString();
            label12.Text = dt.Rows[0]["客户姓名"].ToString();
            label21.Text = dt.Rows[0]["联系电话"].ToString();
            label25.Text = dt.Rows[0]["客户身份证"].ToString();
            label29.Text = dt.Rows[0]["身份验证"].ToString();
            label31.Text = dt.Rows[0]["客户性别"].ToString();
            // pictureBox1.Image = Image.FromFile(dt.Rows[0]["客户身份证照片"].ToString());
            try
            {
                pictureBox1.Image = Image.FromFile(Application.StartupPath + "" + dt.Rows[0]["客户身份证照片"].ToString() + "");//加载图片
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;//自适应图片尺寸大小}

            }
            catch (Exception)
            {
                // pictureBox1.Image = Image.FromFile(Application.StartupPath + "\\images\\default.jpg");//加载图片
                // pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;//自适应图片尺寸大小}
            }
            //DB.cn.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Dispose();
            audit audit = new audit();
            audit.ShowDialog();
        }
    }
}
